<?php

namespace common\models\buss;

use Yii;

/**
 * This is the model class for table "{{%buss_platform}}".
 *
 * @property int $id
 * @property string $name 平台名称
 * @property string $platform_content_type 平台内容类型【1：短视频2：图文3：短内容】
 * @property string $authenticator_rules 认证规则
 * @property int $status 状态【-1：删除、0：禁用、1：启用】
 * @property int $operation_id 操作人ID
 * @property string $operation_name 操作人
 * @property int $created_at 添加时间
 * @property int $updated_at 更新时间
 */
class Platform extends \common\models\base\BaseModel
{
    const STATUS_DELETE = -1;// 删除
    const STATUS_INVALID = 0;// 禁用
    const STATUS_ENABLE = 1;// 正常

    const TYPE_VIDEO = 1;// 短视频
    const TYPE_IMAGE = 2;// 图文
    const TYPE_CONTENT = 3;// 短内容

    public static $statuss = [
        self::STATUS_DELETE => '删除',
        self::STATUS_INVALID => '停用',
        self::STATUS_ENABLE => '正常',
    ];

    public static $types = [
        self::TYPE_VIDEO => '短视频',
        self::TYPE_IMAGE => '图文',
        self::TYPE_CONTENT => '短内容',
    ];
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%buss_platform}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['status', 'operation_id', 'created_at', 'updated_at'], 'integer'],
            [['platform_content_type'], 'required'],
            [['platform_content_type'], 'safe'],
            [['authenticator_rules'], 'string'],
            [['name'], 'string', 'max' => 50],
            [['operation_name'], 'string', 'max' => 100],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'name' => '平台名称',
            'platform_content_type' => '平台内容类型【1：短视频2：图文3：短内容】',
            'authenticator_rules' => '认证规则',
            'status' => '状态【-1：删除、0：禁用、1：启用】',
            'operation_id' => '操作人ID',
            'operation_name' => '操作人',
            'created_at' => '添加时间',
            'updated_at' => '更新时间',
        ];
    }
}
